<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            background-color: rgb(223, 218, 218);
        }
        .box1 {
            width: 200px;
            height: 200px;

            background-color: #bfa;
            margin: 0 auto;
            margin-top: 200px;
            /*  
            通过css来改变元素的形状位置
               变形不会影响网页的布局
                transform: 
                可选值
                 translateX()  沿着x轴平移
                 translateY()   沿着y轴平移
                 translateZ()   沿着z轴平移
                    平移元素是百分比相对于自身
              */
             transform: translatez(100px);
        }

        /* .box2 {
            width: 200px;
            height: 200px;
            background-color: orange;
            margin: 0 auto;
        } */
        .box3{
         
            background-color: orange;
            position: absolute;
            /*
            这种居中方式，这适用于元素的大小确定
             left: 0;
            right: 0;
            top: 0;
            bottom: 0pc;
            margin: auto; */
            left: 50%;
            top: 50%;
            transform: translateX(-50%) translateY(-50%);
            
        }
        .box4,.box5{
            width: 200px;
            height: 300px;
            background-color: white;
            float: left;
            margin: 0 10px;
            transition: transform .3s;
        }
        .box4:hover,.box5:hover{
            transform: translateY(-4px);
            box-shadow: 0 0 10px rgba(0, 0, 0, .3);
            transition: all .3s;

        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3">122</div>
    <div class="box4"></div>
    <div class="box5"></div>
</body>

</html>